<?php
/**
 * DouPHP小程序模块
 * Author: cuihaifeng  qq 366131726 微信同号
 * 网址：www.zbxingke.com www.0533hf.com
 */

$smarty->assign('ur_here', '小程序用户列表');

//获取用户列表

// 分页
$page = $check->is_number($_REQUEST['page']) ? $_REQUEST['page'] : 1;
$page_url = 'wxapp.php?rec=user';
$limit = $dou->pager('wxapp_user', 15, $page, $page_url);

$sql = "SELECT *  FROM " . $dou->table('wxapp_user')  . " ORDER BY id DESC" . $limit;
$query = $dou->query($sql);
while ($row = $dou->fetch_array($query)) {
    $add_time = date("Y-m-d", $row['createtime']);
    $user_list[] = array (
        "id" => $row['id'],
        "openid" => $row['openid'],
        "nickname" => $row['nickname'],
        "avatar" => $row['avatar'],
        "gender" => $row['gender'] == 1?'男':'女',
        "address" => $row['resideprovince'].'-'.$row['residecity'],
        "add_time" => $add_time
    );
}


$smarty->assign('user_list', $user_list);

$smarty->display('wxapp.htm');


